#include <iostream>
using namespace std;
int main(){
	string s,s1;
	int i,j,k;
	cin>>s;
	int len = s.size();
	for(i = 0;i<len;){
		s1 = "";
		if(s[i]=='('){
			for(j = i+1;s[j]!=')';++j)
				s1+=s[j];
			if(s[j+2]>='0'&&s[j+2]<='9'){
				k = (s[++j]-48)*10;
				k+=s[++j]-48;
			}
			else
				k = s[++j]-48;
			for(int L = 0;L<k;++L)
				cout<<s1;
			i = j+1;
			
		}
		else if(s[i]>='0'&&s[i]<='9'){
			s1=s[i-1];
			if(s[i+1]>='0'&&s[i+1]<='9'){
				k=(s[i]-48)*10;
				k+=s[++i]-48;
			}
			else
				k = s[i]-48;
			for(int L = 1;L<k;++L)
				cout<<s1;
			i++;
		}
		else
			cout<<s[i++];
	}
	return 0;
}